package com.chinasofti.fileServer;

import com.chinasofti.po.Data;
import com.chinasofti.fileServer.Temper;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class GetFiletemper {
    public  static List<Temper> readData() throws IOException {
        List<Temper> Tempers =new ArrayList<>();
        //读取文件一行
        BufferedReader br=new BufferedReader(new FileReader("D:\\pxthadoop\\file\\Temper.txt"));
        String len=null;
        while ((len=br.readLine())!=null){
            Temper temper=new Temper();
            String[]strs=len.split("\t");
            temper.setTime(strs[0]);
            temper.setMax(strs[1]);
            temper.setMin(strs[2]);
            Tempers.add(temper);
        }
        return Tempers;
    }

    public static void main(String[] args) throws IOException {
        List<Temper> Tempers=GetFiletemper.readData();
        for (Temper data:Tempers){
            System.out.println(data);
        }
    }
}
